function select_ROIs_hom_data(animalID,regionID)

% num_hom(:,1) = animalID
% num_hom(:,2) = timepoint (-48,...,48)
% num_hom(:,3) = animal DB exp ID
% num_hom(:,4) = ExpID
% num_hom(:,8) = StackID (=ExpID)
% num_hom(:,9) = regionID
adata_dir='C:\Data\AnalyzedData\';
[num_hom,txt_hom]=xlsread('C:\Users\georg\Desktop\HomeostasisExps_101207.xlsx');
tmp_data_dir='E:\RawData\';

curr_ind=find(num_hom(:,1)==animalID&num_hom(:,9)==regionID);
if length(curr_ind)<4
    disp('Region does not exist, or too few data points were acquired - Aborting.')
    return
end
ExpIDs=num_hom(curr_ind,4);
animalIDtxt=txt_hom{min(find(num_hom(:,1)==animalID)),1};
regionIDtxt=txt_hom{min(curr_ind),11};
auxIDs=txt_hom(curr_ind,8);


disp('-----------------')
disp(sprintf('Animal %s (%i) region %i (%s)',animalIDtxt,animalID,regionID,regionIDtxt));
disp('-----------------')

for ind=1:length(ExpIDs)
    [adata_file,mouse_id,date_id]=find_adata_file(ExpIDs(ind),adata_dir);
    adata(ind)=load([adata_dir mouse_id '\' date_id '\' adata_file],'ROIs','template','act_map','ROItrans','bv','np');
    disp(sprintf('t: %i \t expID: %i \t # ROIs: %i - %i',num_hom(curr_ind(ind),2),ExpIDs(ind),length(adata(ind).ROIs),isfield(adata(ind).ROIs,'activity')))

    
    if length(adata(ind).ROIs)>1
        disp('ROIs already selected - skipping');
    else
        [ofile_ID,omouse_ID,odate_ID]=find_adata_file(ExpIDs(1),adata_dir);
        orig=load([adata_dir omouse_ID '\' odate_ID '\' ofile_ID],'template','ROIs','ROItrans','bv','np');
        try
            orig.ROIs=rmfield(orig.ROIs,'activity');
            orig.bv=rmfield(orig.bv,'activity');
            orig.np=rmfield(orig.np,'activity');
        end
        if ~isfield(orig,'ROItrans')
            orig.ROItrans=zeros(3,1);
        end
        assignin('base','orig_template',orig.template);
        load_curr=0;
        
        disp('ROIs were not registered for this Exp - using main ROIs')
        assignin('base','bv',orig.bv);
        assignin('base','np',orig.np);
        assignin('base','ROIs',orig.ROIs);
        assignin('base','ROItrans',orig.ROItrans);
        assignin('base','template',adata(ind).template)
        assignin('base','act_map',adata(ind).act_map)
        assignin('base','adata_dir',adata_dir)
        %evalin('base','save_ROIs(fnames,mouse_id,date_id,ExpGroup)');
        evalin('base','find_cells_gui(template,ROIs,ROItrans,act_map,orig_template)');
        
    end
    go_on=input('Continue? ');
    if ~go_on
        return
    end
end
